<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/11/13 0013
 * Time: 下午 3:23
 */

namespace app\controller;


use app\model\Users;
use think\facade\View;

class Page
{

    function index(){

        //$list = Users::paginate(5);
//        $list = Users::paginate([
//            'list_rows'=>4,
//            'var_page'=>'china'
//        ]);

//        echo $list->count();
//        echo $list->total();
//        echo $list->lastPage();
//        echo $list->render();
        //$list = Users::paginate(5,true);
        $list = Users::paginate(5)->each(function($item){

            $item['sex']=$item['sex']."ok";

            return $item;
        });
//        return View::fetch("index",[
//            'list'=>$list
//        ]);

        return json($list);
    }
}